package com.example.hellodemo.recyclerView;

import android.os.Bundle;

import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.util.Log;
import android.view.View;
import android.widget.Toast;

import com.example.hellodemo.R;

public class LinearHRCyclerViewActivity extends AppCompatActivity {
    private RecyclerView recyclerHR;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_linear_hrcycler_view);
        recyclerHR = findViewById(R.id.recycle_hr);
        LinearLayoutManager manager = new LinearLayoutManager(LinearHRCyclerViewActivity.this);
        manager.setOrientation(RecyclerView.HORIZONTAL);
        recyclerHR.setLayoutManager(manager);
        recyclerHR.setAdapter(new LinearHRCyclerAdapter(LinearHRCyclerViewActivity.this, new LinearHRCyclerAdapter.ItemOnCLick() {
            @Override
            public void onclick(int position) {
                Toast.makeText(LinearHRCyclerViewActivity.this,"positon:" + position,Toast.LENGTH_SHORT).show();
            }
        }));

    }

}
